<?php 
class systemClassAction extends ActionManage
{
	public function upfileAction()
	{
		
	}
	
	public function loginjlAction()
	{
		
	}
	
	
	public function logAction()
	{
		
	}
	
	public function dataAction()
	{
		$limit= (int)$this->get('limit','1');
		$sort = $this->get('sort');
		$dir  = $this->get('dir');
		$order= '`id` desc';
		if($sort && $dir)$order= '`'.$sort.'` '.$dir.'';
		$barr = m('file')->getlimit('1=1', (int)$this->get('page','1'),'*',$order, $limit);

		$rows  = $barr['rows'];
		foreach($rows as $k=>$rs){
			$filepath = $rs['filepath'];
			if(!file_exists($filepath) && isempt($rs['filepathout']))$rows[$k]['ishui'] = 1;
		}
		
		$total = count($rows);
		$barr = array(
			'rows' => $rows,
			'totalCount'=> $barr['count'],
			'success' => true,
		);
		return $barr;
	}
	
	public function dataloginjlAction()
	{
		$limit= (int)$this->get('limit','1');
		$sort = $this->get('sort');
		$dir  = $this->get('dir');
		$order= '`id` desc';
		if($sort && $dir)$order= '`'.$sort.'` '.$dir.'';
		$barr = m('logintoken')->getlimit('1=1', (int)$this->get('page','1'),'*',$order, $limit);

		$rows  = $barr['rows'];
		$dbs   = m('users');
		foreach($rows as $k=>$rs){
			$urs = $dbs->geturs($rs['uid']);
			$rows[$k]['uid'] = arrvalue($urs,'name');
		}
		
		
		$total = count($rows);
		$barr = array(
			'rows' => $rows,
			'totalCount'=> $barr['count'],
			'success' => true,
		);
		return $barr;
	}
	
	public function datalogAction()
	{
		$limit= (int)$this->get('limit','1');
		$sort = $this->get('sort');
		$dir  = $this->get('dir');
		$order= '`id` desc';
		if($sort && $dir)$order= '`'.$sort.'` '.$dir.'';
		$barr = m('log')->getlimit('1=1', (int)$this->get('page','1'),'*',$order, $limit);

		$rows  = $barr['rows'];
		
		
		$total = count($rows);
		$barr = array(
			'rows' => $rows,
			'totalCount'=> $barr['count'],
			'success' => true,
		);
		return $barr;
	}
	
}